home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 12 / 012.d81 / q&d dir display (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  1KB  |  27 lines

  1. 1000 rem@s0:q&d dir display
  2. 1010 rem_q&d dir display
  3. 1020 open15,8,15,"i0":rem initialize in case disk was swapped out
  4. 1030 z$=chr$(0):q$=chr$(34):sp$=chr$(160):il$=chr$(128)
  5. 1040 dimf$(29):rem for file name
  6. 1050 ty$(0)="del":ty$(1)="seq":ty$(2)="prg":ty$(3)="usr":ty$(4)="rel":rem file typs
  7. 1060 open8,8,8,"$":rem open directory
  8. 1070 bu=0
  9. 1080 forc1=1to142:get#8,k$:next:rem space up to disk name
  10. 1090 print"name:";:forc1=144to160:get#8,k$:printk$;:next:print"[146] ";:rem prt name
  11. 1100 get#8,l$,m$,n$:print"id:"m$;n$:rem prt id
  12. 1110 forc1=164to255:get#8,k$:next:rem space up to first file
  13. 1120 forfile=1to144: rem count through files
  14. 1130 forbyte=0to29:get#8,f$(byte):next:ifst=66thenfile=150:goto1240:rem get file
  15. 1140 f$(0)=f$(0)+z$
  16. 1150 iff$(0)<il$then1220:rem deleted or illegal files
  17. 1160 printty$(asc(f$(0))-128);": ";:rem display file type
  18. 1170 printq$;:forlttr=3to18:iff$(lttr)<>sp$thenprintf$(lttr);:rem display file name
  19. 1180 next:printq$;
  20. 1190 sz=256*asc(f$(29)+z$)+asc(f$(28)):rem calc file size
  21. 1200 printtab(23-(sz<100)-(sz<10))sz"block";:ifsz<>1thenprint"s";:rem print size
  22. 1210 print:rem c/r for next file name
  23. 1220 iffile/8<>int(file/8)thenget#8,l$,m$:rem irregularity at block boundary
  24. 1230 bu=bu+sz:sz=0
  25. 1240 nextfile:printbu"of 664 blocks used."
  26. 1250 close8:close15
  27.